#ifndef INCLUDE_PARSER_H
#define INCLUDE_PARSER_H

#include <optional>
#include <tinyxml2/tinyxml2.h>
#include "object/launch_node.h"

class IncludeParser
{
public:
    IncludeParser();

    /**
     * @brief:  解析launch内部某个include类型
     * @param[in]:  element     launch内部的某个类型为node的元素，不为nullptr
     */
    std::optional<LaunchNode> parser(const tinyxml2::XMLElement *element);

private:
    std::optional<LaunchNode> parserInclude(const std::string &fileAttribute);

    /**
     * @brief:  从file attribute中截或查找launch文件路径
     */
    std::optional<std::string> getPackageLaunchFile(const std::string &fileAttribute);
};


#endif //INCLUDE_PARSER_H
